<?php

namespace App\Http\Controllers\Content;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Model\News;
use App\Model\Knowledges;
class ContentController extends Controller
{
    private $nav = [

    ];

    public function index($type, $id){
        if($type === 'news'){
            $content = News::find($id);
        }else if($type === 'knowledges'){
            $content = Knowledges::find($id);
         }
        return view('content',[
            'currentNav' => $type,
            'content' => $content
        ]);
    }
}
